import request from '@/utils/request'

// 获取会议列表
export function listMeetings(query) {
  return request({
    url: '/meetings/page',
    method: 'get',
    params: query
  })
}

// 获取会议详情
export function getMeeting(id) {
  return request({
    url: `/meetings/${id}`,
    method: 'get'
  })
}

// 创建会议
export function createMeeting(data) {
  return request({
    url: '/meetings',
    method: 'post',
    data: data
  })
}

// 更新会议
export function updateMeeting(data) {
  return request({
    url: '/meetings',
    method: 'put',
    data: data
  })
}

// 取消会议
export function cancelMeeting(id) {
  return request({
    url: `/meetings/${id}/cancel`,
    method: 'post'
  })
}

// 获取我组织的会议
export function getMyOrganizedMeetings(query) {
  return request({
    url: '/meetings/my-organized',
    method: 'get',
    params: query
  })
}

// 获取我参与的会议
export function getMyParticipatedMeetings(query) {
  return request({
    url: '/meetings/my-participated',
    method: 'get',
    params: query
  })
}

// 确认参加会议
export function confirmMeeting(id) {
  return request({
    url: `/meetings/${id}/confirm`,
    method: 'post'
  })
}

// 拒绝参加会议
export function rejectMeeting(id) {
  return request({
    url: `/meetings/${id}/reject`,
    method: 'post'
  })
}

// 获取会议统计数据
export function getMeetingStatistics() {
  return request({
    url: '/meetings/statistics',
    method: 'get'
  })
} 